/**
 * 
 */
package Domain;

import java.util.*;

/**
 * @author gth854p
 *
 */
public class CLS_CharCommand implements RuleCommand {
	private Set<String> ruleSet;
	private String name;
	public CLS_CharCommand()
	{
		char[] temp;
		setRuleSet(new HashSet<String>());
		this.name = "CLS_CHAR";
		for(int i = 33;i<127;i++)
		{
			
			if(i==92||i==94||i==91||i==93||i==45)
				{
					temp = new char[2];
					temp[0] = '\\';
					temp[1] = (char) i;
					ruleSet.add(new String(temp));
				}
			else if(i!=46)
			{
				temp  = new char[1];
				temp[0] = (char) i;
				ruleSet.add(new String(temp));
			}
			
			
		}
		
	}
	public CLS_CharCommand(String s)
	{
		setRuleSet(new HashSet<String>());
		this.name = "CLS_CHAR";
		ruleSet.add(s);
	}
	
	
	@Override
	public boolean checkSyntax(String compare) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean checkCorrectness(String compare) {
		// TODO Auto-generated method stub
		return getRuleSet().contains(compare);
	}

	@Override
	public NFADiagram createNFA() {
		System.out.println("CLS_CHARCOMMAND");
		return new NFADiagram();
	}

	
	public void setRuleSet(Set<String> ruleSet) {
		this.ruleSet = ruleSet;
	}


	public Set<String> getRuleSet() {
		return ruleSet;
	}

}
